Calculate the area of a trapezoidΒΆ
Calculate the area of a trapezoid.
Note:
A trapezoid is a quadrilateral with two sides parallel.
The trapezoid is equivalent to the British definition
of the trapezium. An isosceles trapezoid is a trapezoid
in which the base angles are equal so.
Test Data:
Height of trapezoid: 5
Base, first value: 5
Base, second value: 6
Expected output:
Area is : 27.5
base_1 = 5
base_2 = 6
height = float(input("Height of trapezoid: "))
base_1 = float(input('Base, first value: '))
base_2 = float(input('Base, second value: '))
area = ((base_1 + base_2) / 2) * height
print("Area is: ", area)
Output:
Height of trapezoid: 6
Base, first value: 10
Base, second value: 5
Area is: 45.0